package com.tiankong.ware.entity;

import java.math.BigDecimal;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDateTime;
import java.util.List;

import com.tiankong.ware.enums.Status;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * <p>
 * 采购信息
 * </p>
 *
 * @author scl
 * @since 2021-03-22
 */
@Data
@Accessors(chain = true)
@TableName(value = "t_purchase",autoResultMap = true)
public class Purchase {

    private static final long serialVersionUID = 1L;

    /**
     * 采购单id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 采购人id
     */
    private Long assigneeId;

    /**
     * 采购人名
     */
    private String assigneeName;

    /**
     * 联系方式
     */
    private String phone;

    /**
     * 优先级
     */
    private Integer priority;

    /**
     * 状态 : 0 新建  1.已分配  2.已领取 3.已完成 4.有异常
     */
    private Status.Purchase status;

    /**
     * 仓库id
     */
    private Long wareId;

    /**
     * 总金额
     */
    private BigDecimal amount;

    /**
     * 创建日期
     */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 更新日期
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @TableField(exist = false)
    private List<PurchaseDetail> items;
}
